package com.frame.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.UUID;

import com.frame.domain.Department.Columns;
import com.mini.core.WeakEntity;
import com.mini.core.annotation.Column;
import com.mini.core.annotation.Entity;
import com.mini.core.utils.EnumClazz.StrategyType;

/**
 * @author sxjun
 * @version 2016-3-17
 */
@Entity(table="PERMISSION",id="ID",strategy=StrategyType.UUID)
public class Permission extends WeakEntity implements Serializable {
	private static final long serialVersionUID = 1L;

    /**
	 * Columns
	 */
	public static final class Columns {
		public static final String id = "ID";
		public static final String permname = "PERMNAME";
		public static final String permkey = "PERMKEY";
		public static final String permtype = "PERMTYPE";//0:所有;1:页面;2:按钮;3:其他
		public static final String parentid = "PARENTID";
		public static final String description = "DESCRIPTION";
		public static final String createtime = "CREATETIME";
	}
	
	/**
	 * Primary key
	 * @return
	 */
	@Column("id")
    public String getId() {
    	return super.getStr(Columns.id);
	}

    /**
	 * Primary key
	 * @param id
	 * @return
	 */
	public Permission setId(String id) {
		super.set(Columns.id, id);
		return this;
	}

	/**
	 * Get the createtime
	 * @return
	 */
	@Column("createtime")
	public Date getCreatetime() {
		return super.getDate(Columns.createtime);
	}
	
	/**
	 * set the createtime
	 * @param createtime
	 * @return
	 */
	public Permission setCreatetime(Date createtime) {
		super.set(Columns.createtime, createtime);
		return this;
	}
	
	/**
	 * Get permission name
	 * @return
	 */
	@Column("permname")
	public String getPermname() {
		return super.getStr(Columns.permname);
	}

	/**
	 * Set permission name
	 * @param permname
	 * @return
	 */
	public Permission setPermname(String permname) {
		super.set(Columns.permname, permname);
		return this;
	}
	
	/**
	 * Get permission key
	 * @return
	 */
	@Column("permkey")
	public String getPermkey() {
		return super.getStr(Columns.permkey);
	}

	/**
	 * Set permission key
	 * @param permkey
	 * @return
	 */
	public Permission setPermkey(String permkey) {
		super.set(Columns.permkey, permkey);
		return this;
	}
	
	/**
	 * Get permission type
	 * @return
	 */
	@Column("permtype")
	public String getPermtype() {
		return super.getStr(Columns.permtype);
	}

	/**
	 * Set permission type
	 * @param permtype
	 * @return
	 */
	public Permission setPermtype(String permtype) {
		super.set(Columns.permtype, permtype);
		return this;
	}

	/**
	 * Get the description of the permission
	 * @return
	 */
	@Column("description")
	public String getDescription() {
		return super.getStr(Columns.description);
	}

	/**
	 * Set the description of the permission
	 * @param description
	 * @return
	 */
	public Permission setDescription(String description) {
		super.set(Columns.description, description);
		return this;
	}
	
	/**
	 * Get the parentid of the permission
	 * @return
	 */
	@Column("parentid")
	public String getParentid() {
		return super.getStr(Columns.parentid);
	}

	/**
	 * Set the parentid of the permission
	 * @param parentid
	 * @return
	 */
	public Permission setParentid(String parentid) {
		super.set(Columns.parentid, parentid);
		return this;
	}
}
